package com.itheima.demo.demo03.demo03ceshi;

import java.util.HashSet;
import java.util.LinkedList;

//十、已知数组存放一批QQ号码，QQ号码最长为11位
// ，最短为5位String[] strs = {"12345","67891","12347809933",
// "98765432102","67891","12347809933"}。
//将该数组里面的所有qq号都存放在LinkedList中，
// 将list中重复元素删除，将list中所有元素分别用迭代器和增强for循环打印出来。
public class Test_10 {
    public static void main(String[] args) {
        String[] strs = {"12345","67891","12347809933",
"98765432102","67891","12347809933"};
        LinkedList<String>linked=new LinkedList<>();
        linked.add("12345");
        linked.add("67891");
        linked.add("12347809933");
        linked.add("98765432102");
        linked.add("67891");
        linked.add("12347809933");
        HashSet<String>set=new HashSet<>();
        for (String s : linked) {
            set.add(s);
        }
        System.out.println(set);


        }
    }

